<!DOCTYPE html>

<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>剖析Node对象(类)</title>
        
    </head>
    <body>

        <h3>剖析Node对象(类)</h3>
        <p>请在浏览器的终端中查看输出结果</p>
        <!-- .. 表示当前目录的上级目录 -->
        <a href="../index.html">返回首页</a>


        <div class="ma-ta-fei-yan">马踏飞燕</div>

        <script type="text/javascript">
            let names ;

            names = Object.getOwnPropertyNames( Node );
            console.log( names );

            console.log( '- - - '.repeat(5) );

            names = Object.getOwnPropertyNames( Node.prototype );
            console.log( names );

            console.log( '- - - '.repeat(5) );

            console.log( document instanceof Node );
            console.log( document instanceof Document );

            let div = document.querySelector( '.ma-ta-fei-yan' );
            console.log( div instanceof HTMLDivElement );
            console.log( div instanceof Element );
            console.log( div instanceof Node );

            console.log( '- - - '.repeat(5) );

            console.log( div.nodeType , div.nodeName );
            console.log( div.nodeType === Node.ELEMENT_NODE ); // true
            console.log( div.nodeType === div.ELEMENT_NODE ); // true

            console.log( '- - - '.repeat(5) );

            console.log( div.parentNode );
            console.log( div.childNodes );
            
        </script>
    </body>
</html>